package top.mccat.common.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.mccat.common.core.domain.bk.BkProduct;
import top.mccat.common.core.domain.bk.BkProductSupplier;
import top.mccat.common.mapper.bk.BkProductSupplierMapper;
import top.mccat.common.service.IBkProductSupplierService;

/**
 * 产品供货商Service业务层处理
 * 
 * @author raven
 * @date 2022-11-24
 */
@Service
public class BkProductSupplierServiceImpl implements IBkProductSupplierService
{
    @Autowired
    private BkProductSupplierMapper bkProductSupplierMapper;

    /**
     * 查询产品供货商
     * 
     * @param productId 产品供货商主键
     * @return 产品供货商
     */
    @Override
    public BkProductSupplier selectBkProductSupplierByProductId(Long productId)
    {
        return bkProductSupplierMapper.selectBkProductSupplierByProductId(productId);
    }

    /**
     * 查询产品供货商列表
     * 
     * @param bkProductSupplier 产品供货商
     * @return 产品供货商
     */
    @Override
    public List<BkProductSupplier> selectBkProductSupplierList(BkProductSupplier bkProductSupplier)
    {
        return bkProductSupplierMapper.selectBkProductSupplierList(bkProductSupplier);
    }

    /**
     * 新增产品供货商
     * 
     * @param bkProduct 产品
     * @return 结果
     */
    @Override
    public int insertBkProductSupplier(BkProduct bkProduct)
    {
        return bkProductSupplierMapper.insertBkProductSupplier(bkProduct);
    }

    /**
     * 修改产品供货商
     * 
     * @param bkProduct 产品
     * @return 结果
     */
    @Override
    public int updateBkProductSupplier(BkProduct bkProduct)
    {
        return bkProductSupplierMapper.updateBkProductSupplier(bkProduct);
    }

    /**
     * 批量删除产品供货商
     * 
     * @param productIds 需要删除的产品供货商主键
     * @return 结果
     */
    @Override
    public int deleteBkProductSupplierByProductIds(Long[] productIds)
    {
        return bkProductSupplierMapper.deleteBkProductSupplierByProductIds(productIds);
    }

    /**
     * 删除产品供货商信息
     * 
     * @param productId 产品供货商主键
     * @return 结果
     */
    @Override
    public int deleteBkProductSupplierByProductId(Long productId)
    {
        return bkProductSupplierMapper.deleteBkProductSupplierByProductId(productId);
    }
}
